home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 3.0 KB | 95 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWSUSink.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWSUSINK_H
- #define FWSUSINK_H
-
- #include "SLSUSink.xh"
-
- #ifndef FWRANSIN_H
- #include "FWRanSin.h"
- #endif
-
- //========================================================================================
- // CLASS FW_PStorageUnitSink
- // Smart pointer for FW_OStorageUnitSink
- //
- // Inherited API for operator->()
- // long GetReadableBytes();
- // void Read(in void * destination, in long count);
- // long GetWritableBytes();
- // void Write(in void* source, in long count);
- //
- // long GetLength();
- // void SetLength(in long length);
- // long GetPosition();
- // void SetPosition(in long position);
- //
- // New API for operator->()
- // ODStorageUnitView GetStorageUnitView();
- //
- //========================================================================================
-
- class FW_PStorageUnitSink : public FW_PRandomAccessSink
- {
- public:
- FW_PStorageUnitSink(Environment* ev, FW_OStorageUnitSink* theStorageUnitSink);
- // The sink assumes ownership of theStorageUnitSink
-
- FW_PStorageUnitSink(Environment* ev, ODStorageUnitView* storageUnitView);
- // Create a sink attached to the storage unit view.
- // The sink does not assume ownership of the view.
-
- FW_PStorageUnitSink(Environment* ev,
- ODStorageUnit* storageUnit,
- ODPropertyName propertyName,
- ODValueType valueType);
- // Create a sink attached to the given (storageUnit, propertyName, valueType).
- // The "bufferCapacity" is for buffering reads from the storage unit
-
- virtual ~FW_PStorageUnitSink();
-
- operator FW_OStorageUnitSink*() const;
- FW_OStorageUnitSink* operator->() const;
-
- FW_OStorageUnitSink* GetStorageUnitSink() const;
-
- private:
- FW_PStorageUnitSink(const FW_PStorageUnitSink&);
- FW_PStorageUnitSink& operator=(const FW_PStorageUnitSink&);
- };
-
-
- //----------------------------------------------------------------------------------------
- // FW_PStorageUnitSink::operator FW_OStorageUnitSink*
- //----------------------------------------------------------------------------------------
- inline FW_PStorageUnitSink::operator FW_OStorageUnitSink*() const
- {
- return (FW_OStorageUnitSink*)GetRep();
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PStorageUnitSink::operator->
- //----------------------------------------------------------------------------------------
- inline FW_OStorageUnitSink* FW_PStorageUnitSink::operator->() const
- {
- return (FW_OStorageUnitSink*)GetRep();
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PStorageUnitSink::GetStorageUnitSink
- //----------------------------------------------------------------------------------------
- inline FW_OStorageUnitSink* FW_PStorageUnitSink::GetStorageUnitSink() const
- {
- return (FW_OStorageUnitSink*)GetRep();
- }
-
-
- #endif
-